home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kupidon-strike.swf / scripts / DefineSprite_68_bob_obj / frame_1 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  704 b   |  31 lines

  1. speed = 2;
  2. stop();
  3. vx = vectorX;
  4. vy = vectorY;
  5. if(this._name != "bob")
  6. {
  7.    onEnterFrame = function()
  8.    {
  9.       if(this._y > 650 or _xscale <= 10)
  10.       {
  11.          i = 0;
  12.          while(i <= _root.tohit.length)
  13.          {
  14.             if(_root[_root.tohit[i]]._name == _name)
  15.             {
  16.                _root.tohit.splice(i,1);
  17.                i--;
  18.             }
  19.             i++;
  20.          }
  21.          removeMovieClip(this);
  22.       }
  23.       _X = _X + vectorX;
  24.       _Y = _Y - vectorY;
  25.       vectorX *= 0.9000000000000002;
  26.       vectorY *= 0.9000000000000002;
  27.       _xscale = 150 * (vectorX * vectorX + vectorY * vectorY) / (vx * vx + vy * vy);
  28.       _yscale = _xscale;
  29.    };
  30. }
  31.